import { getListApi } from '../api/getIndex.js'
import { ref, reactive, onMounted } from 'vue'
import { replacePropValues, formatDateArray } from '../utils/changeArr.js'
export const useListAsync = () => {
  const list = ref([])
  const count = ref(0)
  const getList = async (url, params) => {
    let res = await getListApi(url, params)
    list.value = replacePropValues(res.data.rows)
    list.value = formatDateArray(list.value)
    count.value = res.data.count

  }
  return { list, getList, count }
}